/*
 * 版权所有 (C) 2013 长沙市红耀通信息技术有限公司。保留所有权利。
 *
 * http://www.zhiqim.com/fadfox/ 欢迎加盟[知凡狐]兴趣小组。
 *
 * 创建说明： 2013-6-29 由 zhichenggang创建
 */
package net.redxyz.repost.resource.action.plan;

import net.redxyz.repost.resource.SessionUser;
import net.redxyz.top.repost.dbo.AssRepostPlanLog;

import org.zhiqim.httpd.HttpRequest;
import org.zhiqim.httpd.context.core.Action;
import org.zhiqim.kernel.paging.PageResult;
import org.zhiqim.orm.ORM;
import org.zhiqim.orm.dbo.Selector;

/**
 * 均衡上下架计划日志
 *
 * @version v7.0.1 @author zouzhigang 2021-7-29 新建与整理
 */
public class RepostPlanLogAction implements Action
{

    public void execute(HttpRequest request) throws Exception
    {
        SessionUser sessionUser = request.getSessionUser(SessionUser.class);
        String nick = sessionUser.getNick();
        int page = request.getParameterInt("page", 1);
        int pageSize = 10;

        Selector selector = new Selector();
        selector.addMaybe("nick", nick);
        selector.addOrderbyDesc("operateTime");
        PageResult<AssRepostPlanLog> result = ORM.table().page(AssRepostPlanLog.class, page, pageSize, selector);

        request.setAttribute("result", result);
    }

}
